package service

import (
	"context"
	"mall-portalv2/internal/model"
)

func (s *Service) CreateCrowdFundingLog(ctx context.Context, insertData model.SmsCrowdFundingLog) (model.SmsCrowdFundingLog, error) {
	result, err := s.dao.CreateCrowdFundingLog(ctx, insertData)
	if err != nil {
		return model.SmsCrowdFundingLog{}, err
	}
	return result, err
}

func (s *Service) QueryCrowdFundingLogWhereMemberIdAndOrdId(ctx context.Context, OrderId, MemberId int64) (model.SmsCrowdFundingLog, error) {
	result, err := s.dao.QueryCrowdFundingLogWhereMemberIdAndOrdId(ctx, OrderId, MemberId)
	if err != nil {
		return model.SmsCrowdFundingLog{}, err
	}
	return result, err
}

func (s *Service) UpdateCrowdFundingLogWhereMemberIdAndOrdId(ctx context.Context, OrderId, MemberId int64, upadtes map[string]interface{}) error {
	if err := s.dao.UpdateCrowdFundingLogWhereMemberIdAndOrdId(ctx, OrderId, MemberId, upadtes); err != nil {
		return err
	}
	return nil
}
